package com.hx.mylombok.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @remark --
 * @author: GuoXiaolin
 * @date 2019/4/24 15:10
 * @Version 1.0
 * @Derction
 */
public abstract class AbstractFileTask {

    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    protected String packageName = null;
    protected String simpleClassName = null;
    protected String sufixName = null;

    public AbstractFileTask(String className){
        logger.info("正在为接口 " + className + " 生成指定文件... ");
        packageName = null;
        String[] cns = className.split("\\.");
        for (int i = 0; i < cns.length - 2; i++) {
            if (packageName == null) {
                packageName = cns[i];
            } else {
                packageName = packageName + "." + cns[i];
            }
        }
        simpleClassName = cns[cns.length - 1];
        logger.info("ImplServiceTask simpleClassName : " + simpleClassName);
        sufixName = simpleClassName.substring(8, simpleClassName.length());
    }
}
